<!DOCTYPE html>
<html lang="en" dir="ltr" >
<head>
	<meta charset="utf-8" />
	<meta name="robots" content="follow, index" />
<!--Lat anh content-->

<?php
$link_hai = array(
    'href' => 'css/lecture_bk.css',
    'rel' => 'stylesheet',
    'type' => 'text/css',
    'media' => 'screen');
echo link_tag($link_hai);

$link_hai = array(
    'href' => 'css/fonts_bk.css',
    'rel' => 'stylesheet',
    'type' => 'text/css',
    'media' => 'screen');
echo link_tag($link_hai);


$link_hai = array(
    'href' => 'css/header_bk.css',
    'rel' => 'stylesheet',
    'type' => 'text/css',
    'media' => 'screen');
echo link_tag($link_hai);


$link_hai = array(
    'href' => 'css/layout_bk.css',
    'rel' => 'stylesheet',
    'type' => 'text/css',
    'media' => 'screen');
echo link_tag($link_hai);

$link_hai = array(
    'href' => 'css/homepage_bk.css',
    'rel' => 'stylesheet',
    'type' => 'text/css',
    'media' => 'screen');
echo link_tag($link_hai);

$link_hai = array(
    'href' => 'css/buttons_bk.css',
    'rel' => 'stylesheet',
    'type' => 'text/css',
    'media' => 'screen');
echo link_tag($link_hai);

echo link_tag('css/home.css', 'stylesheet', 'text/css');

echo link_tag('css/modal.css', 'stylesheet', 'text/css');

echo link_tag('public/css/style.css', 'stylesheet', 'text/css');



?>

		<link href="<?php echo base_url();?>css/lms-application_bk.css" rel="stylesheet" type="text/css"/>
		<link href="<?php echo base_url();?>css/lms-course_bk.css" rel="stylesheet" type="text/css"/>
		<link href="<?php echo base_url();?>css/footer_bk.css" rel="stylesheet" type="text/css"/>


	
	<script src="<?php echo base_url();?>js/jquery-1.js" type="text/javascript"></script>
<!--End-->
<!--SlideShow-->
	<script src="<?php echo base_url(); ?>js/jquery_005.js" type="text/javascript"></script>
	<script type="text/javascript" src="<?php echo base_url(); ?>js/jquery.js"></script>

<!--JS-->
	<script type="text/javascript" src="<?php echo base_url(); ?>js/drupal.js"></script>
	<script type="text/javascript" src="<?php echo base_url(); ?>js/jquery.imagesloaded.js"></script>
	<script type="text/javascript" src="<?php echo base_url(); ?>js/jquery.infinitescroll.js"></script>
	<script type="text/javascript" src="<?php echo base_url(); ?>js/edx.js"></script>

    <!-- Load phan title-->
        <?php $this->load->view('commons/title_head');?>
    <!--Het phan title-->   

</head>

<body class="html front not-logged-in no-sidebars page-home domain-prod-edx-org" >
    <!--******* PAGE HEADER *********************************************************************************/ -->
    <header class="global slim">
        <div class="header-menu clearfix">                 
            <nav class="menu clearfix">
                <ul class="menu">
					<li class="first leaf"><a href="<?php echo base_url()."home_controller/guide";?>" title="">Cách thức hoạt động</a></li>
					<li class="leaf"><a href="#Course_view" title="">Các khóa học</a></li>
                                        <li class="leaf"><a href="<?php echo base_url()."home_controller/school";?>" title="">Nhà trường</a></li>
                    <?php if (isset($user['EMAIL'])== 0){?>
                    <li class="leaf"><a href="#">Hỗ trợ học tập</a>
                        <ul>
                            <li><a href="#">Viết toán bằng tiếng Anh</a></li>
                        </ul>
                    </li>
					<li class="last leaf"><a href="#signup_form" id="">Đăng ký</a></li>
                   
				</ul>            
			</nav>
            <div class="sign-in">
                <a href="#login_form" id="login_pop" class="btn btn-blue" href="#">Đăng nhập</a>
            </div>
            <?php } else {?>
            
                </ul>
            </nav>
			<ol class="user">
				<li class="primary">
					<a href="<?php echo base_url()."user_controller/view_user";?>" class="user-link">
						<span class="avatar"></span>
						<span class="sr">Dashboard for: </span> <?php echo $user['USERNAME'];?>
					</a>
				</li>
				<li class="primary">
					<a href="#" class="dropdown"><span class="sr">More options dropdown</span> ▾</a>
					<ul class="dropdown-menu">
					  
                                            <li><a href="<?php echo base_url()."user_controller/helper" ?>">Trợ giúp</a></li>
					  
					  <li><a href="<?php echo base_url()."user_controller/log_out"?>">Đăng xuất</a></li>
					</ul>
				</li>	
			</ol>
            
            <?php }?>

        </div>
    </header>
    
    <!-- **PHAN DANG KY DANG NHAP**************************************************************************** -->
<a href="#x" class="overlay" id="login_form"></a>
<div class="popup">
    <form class="cmxform" id="loginForm" method="post" name="login" action="<?php echo base_url(); ?>user_controller/login" onsubmit="return validateForm()">
    <fieldset>
        <legend>Đăng nhập</legend>
        <p>
            <label data-field="type_of_user">Loại tài khoản</label>
            <select name="type_of_user">
                <option value="normal_user">Người dùng thông thường</option>
                <option value="in_charge_teacher">Giáo viên phụ trách</option>
            </select>            
        </p>
        <p>
            <label for="cemail">E-Mail<em>*</em></label>
            <input id="cemail" name="email" size="25" />
        </p>
        <p>
            <label for="cpass">Password<em>*</em></label>
            <input type="password" id="cpass" name="password" size="25"/>
        </p>
        <p>
            <input class="submit" type="submit" value="Xác nhận" />
        </p>
    </fieldset>
    </form>
</div>

<a href="#x" class="overlay" id="signup_form"></a>
<div class="popup">
    <form class="cmxform" id="signupForm" method="post" name="signup" action="<?php echo base_url();?>user_controller/signup/" onsubmit="return validateForm1()">
    <fieldset>
        <legend>Đăng ký</legend>
        <p>
            <label for="cemail">E-Mail<em>*</em></label>
            <input id="cemail" name="email" size="25"/>
        </p>
        <p>
            <label for="cpass">Mật khẩu<em>*</em></label>
            <input type="password" id="cpass" name="password" size="25"/>
        </p>
        <p>
            <label for="cemail">Tên đăng nhập<em>*</em></label>
            <input id="cemail" name="username" size="25"/>
        </p>
        <p>
            <label for="cemail">Tên đầy đủ<em>*</em></label>
            <input id="cemail" name="fullname" size="25"/>
        </p>
        <p>
            <label data-field="gender">Giới tính</label>
            <select name="gender">
                <option value="0">Nam</option>
                <option value="1">Nữ</option>
                <option value="other">Khác</option>
            </select>
        </p>
        <p>
            <label data-field="date-of-birth">Năm sinh</label>
            <select name="year_of_birth">
                <?php
                    for($i=2013; $i>1894; $i--)
                        echo '<option value='.$i.'>'.$i.'</option>';          
                ?>
            </select>
        </p>
        <p>
            <label data-field="level-of-school">Bậc học</label>
            <select name="school_level">
                <option value="Tiểu học">Tiểu học</option>
                <option value="THCS">THCS</option>
                <option value="THPT">THPT</option>
                <option value="">khác</option>
            </select>            
        </p>
        <p>
            <label for="cemail">Học trường</label>
            <input id="cemail" name="user_school" size="25"/>
        </p>
        <p>
            <input class="submit" type="submit" value="Ghi nhận" />
        </p>
        
    </fieldset>
</form>
</div>

<script>
    function validateForm()
    {
        var x=document.forms["login"]["email"].value;
        var y=document.forms["login"]["password"].value;
        var atpos=x.indexOf("@");
        var dotpos=x.lastIndexOf(".");
        if(x == null || x == "")
        {
            alert("Bạn chưa nhập email");
            return false;
        }
        else
        {
            if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
            {
                alert("Không đúng định dạng email");
                return false;
            }
        }
        if (y == null || y == "")
        {
            alert("Bạn chưa nhập mật khẩu");
            return false;
        }
    }
    function validateForm1()
    {
        var email=document.forms["signup"]["email"].value;
        var pass=document.forms["signup"]["password"].value;
        var name=document.forms["signup"]["username"].value;
        var fullname=document.forms["signup"]["fullname"].value;
        var gender = document.forms["signup"]["gender"].value;
        
        var atpos=email.indexOf("@");
        var dotpos=email.lastIndexOf(".");
        
        if(email == null || email == "")
        {
            alert("Bạn chưa nhập email");
            return false;
        }
        else
        {
            if (atpos<1 || dotpos<atpos+2 || dotpos+2>=email.length)
            {
                alert("Không đúng định dạng email");
                return false;
            }
        }
        if (pass == null || pass == "")
        {
            alert("Bạn chưa nhập mật khẩu");
            return false;
        }
        if (name == null || name == "")
        {
            alert("Bạn chưa nhập tên đăng nhập");
            return false;
        }
        if (fullname == "" || fullname == null)
        {
            alert("Bạn chưa nhập tên đầy đủ");
            return false;
        }
        
    }
</script>
    
    <!-- ****** MAIN CONTENT ******************************************************************************** -->
    <div id="page-wrapper">
        <div id="page"> 
            <div id="content_bk" role="main">
                 <div class="region region-content">
					<div class="panel-flexible panels-flexible-2 clearfix" >
						<div class="panel-flexible-inside panels-flexible-2-inside">							
    <!-- This is the template for the Banner in the HomePage -->
							<div style="background:url('<?php echo base_url();?>images/bg-banner_0.jpg') repeat-x; background-color: #FFF;">
								<div class="home-page-banner-inside">
									<div style="position: relative;" class="slideshow">
										<a href="<?php echo base_url()."introduce_policy_controller/introduce_web";?>">
											<img src="<?php echo base_url();?>images/web_logos/banner1c.png" alt="a1"/>		
										</a>															
										<a  href="<?php echo base_url()."introduce_policy_controller/introduce_web";?>">
											<img src="<?php echo base_url();?>images/web_logos/banner2c.png" alt="" /></a>
									</div>
									<script type="text/javascript">						
										jQuery(document).ready(function() {
											jQuery('.slideshow').cycle({
												fx: 'fade',
												
													before: function(curr, next, opts) {
														opts.animOut.opacity = 0;
													}

												}); 
											});     
									</script>									
								</div>
							</div>
						<!-- <div class="register-button">
									<a class="btn btn-blue" href="/course-list/allschools/allsubjects/allcourses" title="Find a Course & Start Learning">Find a Course & Start Learning</a>
								</div> -->
						<!--Scroll-->
							<div class="panels-flexible-region panels-flexible-region-2-schools panels-flexible-region-first panels-flexible-region-last home-page-schools">
								<div class="view view-schools-view view-id-schools_view view-display-id-block_home_page_schools home-page-slider-schools view-dom-id-939d4a707f615068c70c34837fbd7618">
									<div class="view-content">
										<div class="schools-back">
										</div>
										<div class="schools-slider-container clearfix">
											<div class="views-row views-row-1 views-row-odd views-row-first">
    <!-- This is the template for every School logo in Home Page -->
												<div class="tiles school-homepage-logo clearfix">
													<a href="<?php echo $jskull[0]['LINK'];?>" title="<?php echo $jskull[0]['NAME']?>" class="school-link">
														<img src="<?php echo base_url();?>images/jskull_logos/<?php echo $jskull[0]['IMG'];?>" width="185" height="48" alt="HUS University" title="<?php echo $jskull[0]['NAME'];?>"/>
													</a>
												</div>  
											</div>
    
                                            <?php $i = 1;
                                            for ($i = 1; $i < $jskull['quant']; $i++){
                                                if (($i % 2) != 0){?>
                                            
											<div class="views-row views-row-<?php echo $i;?> views-row-odd">
    <!-- This is the template for every School logo in Home Page -->
												<div class="tiles school-homepage-logo clearfix">
													<a href="<?php echo $jskull[$i]['LINK'];?>" title="<?php echo $jskull[$i]['NAME']?>" class="school-link">
														<img src="<?php echo base_url();?>images/jskull_logos/<?php echo $jskull[$i]['IMG'];?>" width="48" height="48" alt="HUS University" title="<?php echo $jskull[$i]['NAME']?>" />
													</a>
													</div>
                                                    
												</div>
                                            <?php } else {?>
 											<div class="views-row views-row-<?php echo $i;?> views-row-even">
    <!-- This is the template for every School logo in Home Page -->
												<div class="tiles school-homepage-logo clearfix">
													<a href="<?php echo $jskull[$i]['LINK'];?>" title="<?php echo $jskull[$i]['NAME']?>" class="school-link">
														<img src="<?php echo base_url();?>images/jskull_logos/<?php echo $jskull[$i]['IMG'];?>" width="48" height="48" alt="HUS University" title="<?php echo $jskull[$i]['NAME']?>" />
													</a>
													</div>
												</div>
                                            
                                            <?php }?>
								            <?php }?>
                                
										</div>
										<div class="schools-next">
										</div>
									</div>
								</div>
							</div>
						<!--End Scroll-->
                        
							<div class="panels-flexible-region panels-flexible-region-2-tiles panels-flexible-region-first panels-flexible-region-last home-page-tiles">						
											
	<!-- This is the template for the course tile in Home Page -->
    
								<div class="new-home-page-tiles-inside">
						
								<a NAME="Course_view"></a>
                                
                                <?php $i = 1;
                                for ($i = 1; $i <= $course['quant']; $i++){?>	
                                <div id="user_right_content">
                                <div class="home_course_img">
                                    <img src="<?php echo base_url();?>images/course_imgs/<?php echo $course[$i]['img'].".jpg";?>" width="270" height="180" alt="Course-image" title="Course-introduce" />
                                </div>                    
                                <div class="home_course_content">
                                <div class="home_course_name">
                                    <h3><?php echo $course[$i]['code'].":".$course[$i]['name'];?></h3>
                                </div>
                                <div class="home_course_introduce_nmh">
                                    <?php echo $course[$i]['introduce'];?>
                                </div>
                                
                                <?php if($this->session->userdata['user_data'] == "user") {?>
                                    <a href="<?php echo base_url();?>course_controller/show_fedx_course_overview/<?php echo $course[$i]['course_id'];?>">
                                <?php } else {?>
                                    <a href="<?php echo base_url();?>course_controller/course_overview_unsign/<?php echo $course[$i]['course_id'];?>">
                                <?php }?>
                                <div class="home_course_open_day_lecturer">
                                    <?php $new_date_format = new DateTime($course[$i]['open_day']);?>
                                    Thời gian: <?php echo $new_date_format->format('d/m/Y');?> - 
                                    
                                    <?php $new_date_format->modify('+'.$course[$i]['course_lecture_quan'].'weeks');?>
                                    <?php echo $new_date_format->format('d/m/Y');?> Giáo viên: <?php echo $course[$i]['main_lecturer'];?>
                                </div>
                                </a>
 
  
                                </div>
                        
                                </div>
                                <?php }?>                                  
                                                                      
                                    
								</div>  
							</div>
						</div>	
					</div>	
				</div>
            </div> <!-- /#content -->       
            <div id="main-wrapper">
                <div id="main" class="clearfix with-navigation">
        
                </div>
            </div> <!-- /#main, /#main-wrapper -->    
        </div>    
    </div> <!-- /#page, /#page-wrapper -->
    <?php $this->load->view('commons/footer_all');?>
</body>
</html>
